import 'vuetify/styles'
import '@mdi/font/css/materialdesignicons.css'
import { createVuetify } from 'vuetify'
import * as components from 'vuetify/components'
import * as directives from 'vuetify/directives'
import VueGridLayout from 'vue-grid-layout'
import { createApp } from 'vue'
import { createPinia } from 'pinia'
import App from './App.vue'
import router from '../src/router/index'
import widgets from './widget/index'
import './ipcRender/index'
import '../src/store/user'
import './styles/main.css'
import '@imengyu/vue3-context-menu/lib/vue3-context-menu.css'
import ContextMenu from '@imengyu/vue3-context-menu'

const pina = createPinia()
const vuetify = createVuetify({
  components,
  directives,
  theme: {
    defaultTheme: 'light'
  },
  icons: {
    defaultSet: 'mdi'
  }
})

const app = createApp(App).use(router).use(VueGridLayout).use(vuetify).use(pina).use(ContextMenu)
widgets.forEach(({ key, component }) => {
  app.component(key, component)
})

app.mount('#app')
export default app
